package com.edu.controller;

import com.edu.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

@Controller
public class UserController {

    @RequestMapping("/user")
    @ResponseBody
    private Object user(){
        return new User(1,"zhangsan","123456",new Date());
    }

    @RequestMapping("/users")
    @ResponseBody
    private Object users(){
        List<User> users = Arrays.asList(new User(1,"zhangsan","123456",new Date()),new User(2,"lisi","123456",new Date()));
        return users;
    }

}
